package me.ereach.hashtable;

public class User implements Comparable<User> {
    private String name;
    private String gender;
    private String email;
    private Integer age;

    public User(String name, String gender, String email, Integer age) {
        this.name = name;
        this.gender = gender;
        this.email = email;
        this.age = age;
    }

    public String getEmail() {
        return email;
    }

    @Override
    public int compareTo(User o) {
        return this.age - o.age;
    }

    @Override
    public String toString() {
        return "User { name: " + name + ", gender: " + gender + ", email: " + email + ", age: " + age + " }";
    }
}
